home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / vol16n13.zip / OPENTR.ZIP / OT_SRC.ZIP / EXPDLG.CPP next >
C/C++ Source or Header  |  1997-05-26  |  2KB  |  90 lines

  1. // ExpDlg.cpp : implementation file
  2. //
  3. // This module implements the Export Options dialog.
  4. // OpenTrap Version 1.00 by Gregory A. Wolking
  5. // Copyright ⌐ 1997 Ziff-Davis Publishing
  6. // First published in PC Magazine, US Edition, July 1997.
  7.  
  8. #include "stdafx.h"
  9. #include "OpenTrap.h"
  10. #include "OTExtern.h"
  11. #include "ExpDlg.h"
  12.  
  13. #ifdef _DEBUG
  14. #define new DEBUG_NEW
  15. #undef THIS_FILE
  16. static char THIS_FILE[] = __FILE__;
  17. #endif
  18.  
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CExpDlg dialog
  21.  
  22.  
  23. CExpDlg::CExpDlg(CWnd* pParent /*=NULL*/)
  24.     : CDialog(CExpDlg::IDD, pParent)
  25. {
  26.     //{{AFX_DATA_INIT(CExpDlg)
  27.     m_bUseFilters = FALSE;
  28.     m_intFormat = -1;
  29.     m_bRecNums = FALSE;
  30.     //}}AFX_DATA_INIT
  31. }
  32.  
  33.  
  34. void CExpDlg::DoDataExchange(CDataExchange* pDX)
  35. {
  36.     CDialog::DoDataExchange(pDX);
  37.     //{{AFX_DATA_MAP(CExpDlg)
  38.     DDX_Control(pDX, IDC_chkUseFilters, m_chkUseFilters);
  39.     DDX_Check(pDX, IDC_chkUseFilters, m_bUseFilters);
  40.     DDX_Radio(pDX, IDC_optFormat, m_intFormat);
  41.     DDX_Check(pDX, IDC_chkRecNums, m_bRecNums);
  42.     //}}AFX_DATA_MAP
  43. }
  44.  
  45.  
  46. BEGIN_MESSAGE_MAP(CExpDlg, CDialog)
  47.     //{{AFX_MSG_MAP(CExpDlg)
  48.     ON_WM_CONTEXTMENU()
  49.     //}}AFX_MSG_MAP
  50.     ON_COMMAND(ID_CONTEXT_HELP, OnContextHelp)
  51. END_MESSAGE_MAP()
  52.  
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CExpDlg message handlers
  55.  
  56. BOOL CExpDlg::OnInitDialog() 
  57. {
  58.     CDialog::OnInitDialog();
  59.     // Disable the Filtered Records Only checkbox if there are no filters in effect.
  60.     m_chkUseFilters.EnableWindow(g_bUseFilters);
  61.     return TRUE;                  
  62. }
  63.  
  64. // Handler for right-mouse help.
  65. void CExpDlg::OnContextMenu(CWnd* pWnd, CPoint point)
  66. {
  67.     CPoint ptClient = point;
  68.     CWnd* wndTarget;
  69.     UINT id = 0;
  70.     ScreenToClient(&ptClient);
  71.     wndTarget = ChildWindowFromPoint(ptClient, CWP_SKIPTRANSPARENT);
  72.     if (wndTarget == this)
  73.         wndTarget = ChildWindowFromPoint(ptClient);
  74.     if (wndTarget)
  75.         id = wndTarget->GetDlgCtrlID();
  76.     if (id == 0 || id == IDOK || id == IDCANCEL)
  77.         return;
  78.     else
  79.         m_intHelpContext = id + 0x40000;
  80.     CMenu my_menu;
  81.     my_menu.CreatePopupMenu();
  82.     my_menu.AppendMenu(MF_ENABLED, ID_CONTEXT_HELP, "What's this?");
  83.     my_menu.TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON, point.x, point.y, this);
  84. }
  85.  
  86. void CExpDlg::OnContextHelp()
  87. {
  88.     WinHelp(m_intHelpContext, HELP_CONTEXTPOPUP);
  89. }
  90.